Check if folder exists before deleting sync db and VFS sync root connection.
authorCamila Ayres <hello@camilasan.com>
Tue, 18 Feb 2025 16:59:09 +0000 (17:59 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 20 Feb 2025 08:59:03 +0000 (08:59 +0000)
Fix for #7860.

Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/folder.cpp

index 0d7166acb92d10f97b83a85bc4688d05d82edbec..85e0049950bb5bca8cceeb95107d64a8a48a58a0 100644 (file)
@@ -1020,15 +1020,20 @@ void Folder::slotTerminateSync()
 
 void Folder::wipeForRemoval()
 {
-    // Delete files that have been partially downloaded.
-    slotDiscardDownloadProgress();
-
     disconnectFolderWatcher();
 
     // Unregister the socket API so it does not keep the .sync_journal file open
     FolderMan::instance()->socketApi()->slotUnregisterPath(alias());
     _journal.close(); // close the sync journal
 
+    if (!QDir(path()).exists()) {
+        qCCritical(lcFolder) << "db files are not going to be deleted, sync folder could not be found at" << path();
+        return;
+    }
+
+    // Delete files that have been partially downloaded.
+    slotDiscardDownloadProgress();
+
     // Remove db and temporaries
     QString stateDbFile = _engine->journal()->databaseFilePath();